package cate.game.role.farm.island.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBIsland;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "迷失神庙选择难度的请求")
public class IslandChooseReq implements MsgInput {
    @NoteField(value = "难度 1普通 2深渊")
    public int difficulty;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getFarm().island.chooseMap(difficulty);
        if(!r.ok()){
            game.notice.message(cc.getRole(), r.message);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBIsland.CHOOSE_REQ;
    }
}
